-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logic Toolbox #308
base: upsilon-dev
Are you sure you want to change the base?
Logic Toolbox #308
Conversation
- negative numbers can now be displayed in 2's compliment binary
|
apps/toolbox.fr.i18n
Outdated
LogicalRotateLeft = "Rotation gauche de a par r bits" | ||
LogicalRotateRight= "Rotation droite de a par r bits" | ||
TwosComplementToBits = "Equivalent en complément à deux" | ||
CeilingLog2 = "Nombre de bits nécessaires pour stocker a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text is too long (maybe shortening Nombre to nb would help)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Nombre de bits nécessaires pour stocker a' is now 'Nb de bits nécessaires pour stocker a'
apps/toolbox.fr.i18n
Outdated
LogicalBitClear = "Effacer le bit numéro b dans a" | ||
LogicalBitFlip = "Inverser le bit numéro b dans a" | ||
LogicalBitGet = "Obtenir le bit numéro b dans a" | ||
LogicalBitSet = "Allumer le bit numéro b dans a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allumer is not the right word here. I'd use something like mettre/définir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed 'Allumer' to 'Mettre'
|
Binary Logic Toolbox
Numworks is about to release some basic binary functions in Epsilon. I tried them out, and they are honestly pretty useless, with inputs of just 'True' and 'False' and just AND/OR/NOT functions. Here's my take on a toolbox with much more powerful logic functions to be used on both unsigned and signed integers. I have also extended the '...' (Additional Results) display to show the 2's complement binary/hex of negative numbers.
Additional Results
Negative integers can now be displayed in binary/hex. Simply navigate to the ellipsis ('...') on the right of a negative integer result to see a 2's complement representation of the number:
Functions Implemented
Basic Logic Operations
AND
OR
XOR - Exclusive OR
NOT
Bit Shifts
Shift Logical Left
Shift Logical Right
Arithmetic Shift Right
Rotate Left
Rotate Right
Setting And Clearing Bits
Get Bit
Set Bit
Clear Bit
Flip Bit
Clear 'a' With 'b'
Logic Operations (With Explicit Number of Bits)
Some logic operations (like NOT) end up generating large 32-bit numbers as the default precision is 32 bits. This adds frustration when 32 bits of precision is undesired. So some of the functions have overridden methods that have an extra argument that allows the user to control the number of output bits.
2'S Compliment Conversions/Helpers
2's Compliment Equivalent
Ceiling Log2
Other Information